package com.jmoney.luckeylink.handler;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.testng.Assert;
import org.testng.Reporter;

import com.jmoney.luckeylink.controller.LekeW_AuthorizeIC_Controller;
import com.jmoney.luckeylink.util.ExcelUtil;
import com.jmoney.luckeylink.util.HttpGetRequestUtil;
import com.jmoney.luckeylink.util.MobileApiToolsUtil;
import com.jmoney.luckeylink.util.StringUtil;
import com.jmoney.luckeylink.util.DecodeUnicodeUtil;

public class LekeW_AuthorizeIC_Handler {
    private static Logger logger = Logger.getLogger(LekeW_AuthorizeIC_Handler.class);
    static int Start_INDEX=0;
    static int End_INDEX=0;
    static int TITLE_LINE_INDEX=0;
    static int Act_Number=0;
    static int ArgName_Number=0;

    static Object[] AuthorizeICInfo=null;
    static String message_Act=null;
    static int status_Act=0;
    static String status_name_Act=null;
    
    static String ApiUrl=null;
    static String method=null;
    static String Param=null;
    
	/**
	 * <br>获取Excel数据</br>
	 * @author  刘智King
	 * @date     2018年4月20日 下午6:01:04
	 */
    public static void GetExcelInstance() {
        logger.info(LekeW_AuthorizeIC_Handler.class);
        System.out.println(LekeW_AuthorizeIC_Handler.class);
		ExcelUtil.getInstance().setFilePath("src/test/java/TestCasexls/JMoney.Luckeylink.Api.xlsm");
		ExcelUtil.getInstance().setSheetName("LekeW_AuthorizeIC");
    }
    
    /**
	 * <br>初始化Excel数据</br>
	 * @author  刘智King
	 * @date     2018年4月20日 下午6:01:04
	 */
    public static void InitializeExcelData() { 
    	GetExcelInstance();
    	Start_INDEX=Integer.parseInt(ExcelUtil.getInstance().readExcelCell(1, 5));
    	End_INDEX=Integer.parseInt(ExcelUtil.getInstance().readExcelCell(2, 5));
    	TITLE_LINE_INDEX=Integer.parseInt(ExcelUtil.getInstance().readExcelCell(Start_INDEX, End_INDEX));
	    Act_Number=Integer.parseInt(ExcelUtil.getInstance().readExcelCell(Start_INDEX+1, End_INDEX));
	    ArgName_Number=Integer.parseInt(ExcelUtil.getInstance().readExcelCell(Start_INDEX+2, End_INDEX));
    	int color = 4;
        try {
            logger.info("初始化: " + ExcelUtil.getInstance().getFilePath() + ", " + ExcelUtil.getInstance().getSheetName());
            System.out.println("开始初始化: " + ExcelUtil.getInstance().getFilePath() + ", " + ExcelUtil.getInstance().getSheetName());
            
            MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3)+"", "", color);
            System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3)+"列");
            if(Act_Number<1){
            	for(int i =1;i<Act_Number+6;i++){
                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+i)+"", "", color);
                	System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+i)+"列");
//                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+1)+"", "", color);
//                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+2)+"", "", color);
//                    MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+3)+"", "", color);
//                    MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+4)+"", "", color);
//                    MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+5)+"", "", color);
//                    MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+6)+"", "", color);
            	}
            }else if(Act_Number==1){
            	for(int i =1;i<Act_Number+6;i++){
                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+i)+"", "", color);
                	System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+i)+"列");
//                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+1)+"", "", color);
//                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+2)+"", "", color);
//                    MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+3)+"", "", color);
//                    MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+4)+"", "", color);
//                    MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+5)+"", "", color);
//                    MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number+6)+"", "", color);
            	}
            }else if(Act_Number>1){
            	for(int i =1;i<Act_Number+1;i++){
            		if(StringUtil.isEqual(ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*i), ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*i+2))){
            			System.out.println("效验值："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*i)+"重复，请检查后重试！");
            			System.exit(0);
            		}else{
            			MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*i)+"", "", color);
                    	System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*i)+"列");
            		}
//                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*1)+"", "", color);
//                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*2)+"", "", color);	
//                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*3)+"", "", color);
//                	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+2*4)+"", "", color);
            	}
            	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+1)+"", "", color);
            	System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+1)+"列");
            	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+2)+"", "", color);
            	System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+2)+"列");
            	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+3)+"", "", color);
            	System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+3)+"列");
            	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+4)+"", "", color);
            	System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+4)+"列");
            	MobileApiToolsUtil.initializeData(TITLE_LINE_INDEX, ""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+5)+"", "", color);
            	System.out.println("正在初始化："+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 3+ArgName_Number+Act_Number*2+5)+"列");
            }            
           
            logger.info(ExcelUtil.getInstance().getFilePath() + ", " + ExcelUtil.getInstance().getSheetName() + " 初始化完成");
            System.out.println(ExcelUtil.getInstance().getFilePath() + ", " + ExcelUtil.getInstance().getSheetName() + " 初始化完成");
            System.out.println("==================================================================");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    
	/**
	 * <br>根据用例ID，执行AuthorizeIC相关接口请求，获取Json信息，并写入结果到Excel</br>
	 * @author  刘智King
	 * @date     2018年4月20日 下午6:01:04
	 * @param  ID
	 */
    public static void AuthorizeIC(int ID) throws Exception {
    	GetExcelInstance();
        boolean ArgName = false;
        List<Map<String, String>> data = null;
        
        String PremiseUrl = ExcelUtil.getInstance().readExcelCell(1, 2);
        String ApiUrl1 = ExcelUtil.getInstance().readExcelCell(2, 2);
        String ApiUrl2 = ExcelUtil.getInstance().readExcelCell(3, 2);
        String ApiUrl3 = ExcelUtil.getInstance().readExcelCell(4, 2);
        String ApiUrl4 = ExcelUtil.getInstance().readExcelCell(5, 2);
        String Act = ExcelUtil.getInstance().readExcelCell(6, 2);
        String Method = ExcelUtil.getInstance().readExcelCell(7, 2);
        ArgName = MobileApiToolsUtil.isArgEquals(8, 2, TITLE_LINE_INDEX);

        if (PremiseUrl.equals("") ||ApiUrl1.equals("") ||ApiUrl2.equals("") ||ApiUrl3.equals("") ||ApiUrl4.equals("") ||Act.equals("") ||Method.equals("")||!ArgName) {
            logger.error("请检查 Excel 中 PremiseUr、ApiUrl、Act、Method、ArgName 是否设置正确...");
            System.out.println("请检查 Excel 中 PremiseUr、ApiUrl、Act、Method、ArgName 是否设置正确...");
            System.exit(-1);
        }

        data = ExcelUtil.getInstance().readExcelAllData(TITLE_LINE_INDEX);

        if (data != null) {
            int i = ID;
            //根据Excel列名称,获取单元格内容
            Map<String, String> map = data.get(i-1);
            String CaseID = map.get(""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 1)+"");
            String CaseName = map.get(""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, 2)+"");
            
            int index=4;
            String mobile = map.get(""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, index)+"");
            String ic_card_apply_id = map.get(""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, index+1)+"");
            String content = map.get(""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, index+2)+"");
            String lock_list = map.get(""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, index+3)+"");
            String ic_card_number = map.get(""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, index+4)+"");
            String type = map.get(""+ExcelUtil.getInstance().readExcelCell(TITLE_LINE_INDEX, index+5)+"");
            
            //写入Run列, 执行纪录
            MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "Run", "Y");

            //指定请求的Api地址
            String LoginUrl = PremiseUrl+"?"+"type=1&mobile="+mobile+"&captcha=1234";
            String token = HttpGetRequestUtil.GetJsonDataStringValue(LoginUrl,"data.token");
            
            if(ID==1){
            	 //指定拒绝IC卡申请接口及参数
              	 ApiUrl = ApiUrl1;
              	 method = "POST";
              	 Param ="ic_card_apply_id="+ic_card_apply_id+"&content="+content+"&token="+token+"";
              	 AuthorizeICInfo=LekeW_AuthorizeIC_Controller.GetAuthorizeICInfo(ApiUrl,Param);
              	 
              	 //从AuthorizeICInfo数组中，读取message_Act结果并写入       
                 message_Act = (String) AuthorizeICInfo[2];
                 MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "message_Act", message_Act);
            }else if(ID==2){
            	 //指定写入IC卡接口及参数
              	 ApiUrl = ApiUrl2;
              	 method = "POST";
              	 Param ="ic_card_apply_id="+ic_card_apply_id+"&lock_list="+lock_list+
                   		"&ic_card_number="+ic_card_number+"&token="+token+"";
              	 AuthorizeICInfo=LekeW_AuthorizeIC_Controller.GetAuthorizeICInfo(ApiUrl,Param);
              	 
              	  //从AuthorizeICInfo数组中，读取message_Act结果并写入       
                 message_Act = (String) AuthorizeICInfo[2];
                 MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "message_Act", message_Act);
            }else if(ID==3){
            	 //指定通过IC卡申请接口及参数
              	 ApiUrl = ApiUrl3;
              	 method = "POST";
              	 Param ="ic_card_apply_id="+ic_card_apply_id+"&type="+type+"&token="+token+"";
                 AuthorizeICInfo=LekeW_AuthorizeIC_Controller.GetAuthorizeICInfo(ApiUrl,Param);
                
                 //从AuthorizeICInfo数组中，读取message_Act结果并写入       
                 message_Act = (String) AuthorizeICInfo[2];
                 MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "message_Act", message_Act);
            }else if(ID==4){
            	 //指定获取IC卡申请结果接口及参数
             	 ApiUrl = ApiUrl4;
             	 method = "GET";
             	 Param = "ic_card_apply_id="+ic_card_apply_id+"&token="+token+"";
             	 String AuthorizeUrl = ApiUrl+"?"+Param;
             	 AuthorizeICInfo=LekeW_AuthorizeIC_Controller.GetAuthorizeICInfo(AuthorizeUrl); 
             
             	 //从AuthorizeICInfo数组中，读取status_Act结果并写入 
                 status_Act = (int) AuthorizeICInfo[3];
                 MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "status_Act", String.valueOf(status_Act));
                 
                 //从AuthorizeICInfo数组中，读取status_name_Act结果并写入 
                 status_name_Act = (String) AuthorizeICInfo[4];
                 MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "status_name_Act", status_name_Act);
            }
            
            //从AuthorizeICInfo数组中，读取StatusCode并写入
            int StatusCode = (int) AuthorizeICInfo[1];
            MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "StatusCode", String.valueOf(StatusCode));
            
            //判断StatusCode结果是否等于200，成立则TestResult写入OK并设置单元格颜色为绿色，反则写入NG并设置单元格颜色为红色，并写入失败消息提示
            if (StatusCode == 200){
            	ExcelUtil.getInstance().setCellBackgroundColor(TITLE_LINE_INDEX, "StatusCode",TITLE_LINE_INDEX + i, 1);
            	MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "TestResult", "OK");
                ExcelUtil.getInstance().setCellBackgroundColor(TITLE_LINE_INDEX, "TestResult",TITLE_LINE_INDEX + i, 1);
            }else{
            	ExcelUtil.getInstance().setCellBackgroundColor(TITLE_LINE_INDEX, "StatusCode",TITLE_LINE_INDEX + i, 0);
            	MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "TestResult", "NG");
            	ExcelUtil.getInstance().setCellBackgroundColor(TITLE_LINE_INDEX, "TestResult",TITLE_LINE_INDEX + i, 0);
            	//从AuthorizeICInfo数组中，读取message消息结果并写入
            	String message = (String) AuthorizeICInfo[2];
                MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "FailHint", "【message】"+message+"");
            }

            //写入执行时间
            MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "RunningTime", MobileApiToolsUtil.getDate());

            //从AuthorizeICInfo数组中，读取JSON结果并编码转换后写入
            String Json = (String) AuthorizeICInfo[0];
            String NewJson=DecodeUnicodeUtil.decodeUnicode(Json);
            MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "Json", NewJson);
            
            Reporter.log("用例ID: "+ CaseID);        
	        Reporter.log("用例名称: "+ CaseName);
	        Reporter.log("请求地址: "+ ApiUrl);
	        Reporter.log("请求方式: "+ method);
	        Reporter.log("请求参数: "+ Param);
	        Reporter.log("返回结果: "+ NewJson);
	        
	        if(ID==1||ID==2||ID==3){
	        	//检查预期结果和实际结果是否正确
		        String message_Exp = map.get("message_Exp");
		        checkEquals(message_Exp,message_Act,"message_Exp","message_Act",ID);
	        }else if(ID==4){
	        	//检查预期结果和实际结果是否正确
		        String status_Exp = map.get("status_Exp");
		        checkEquals(status_Exp,String.valueOf(status_Act),"status_Exp","status_Act",ID);
		        String status_name_Exp = map.get("status_name_Exp");
		        checkEquals(status_name_Exp,String.valueOf(status_name_Act),"status_name_Exp","status_name_Act",ID);
	        }
        }
    }

	/**
	 * <br>根据用例ID，检查预期与实际是否相等，不等则提示错误信息，并写入结果</br>
	 * @author  刘智King
	 * @date     2018年4月20日 下午6:01:04
	 * @param  ID
	 */
	public static void checkEquals(String Expected,String Actual,String ExpectedList,String ActualList,int ID) throws Exception{
		int i = ID;
		try {
			Assert.assertEquals(Expected,Actual);
			MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "TestResult", "OK");
            ExcelUtil.getInstance().setCellBackgroundColor(TITLE_LINE_INDEX, "TestResult",TITLE_LINE_INDEX + i, 1);
			Reporter.log("用例结果: 〖"+ExpectedList.replace("_Exp", "")+"〗=>Expected: " + "【"+Expected+"】" + ", Actual: "+ "【"+Actual+"】");
	        System.out.println("用例结果: 【"+ExpectedList.replace("_Exp", "")+"】=>Expected: " + "【"+Expected+"】" + ", Actual: "+ "【"+Actual+"】");
        }catch (Error e)  {
 	    	MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "TestResult", "NG");
        	ExcelUtil.getInstance().setCellBackgroundColor(TITLE_LINE_INDEX, "TestResult",TITLE_LINE_INDEX + i, 0);
 	    	ExcelUtil.getInstance().setCellBackgroundColor(TITLE_LINE_INDEX, ActualList,TITLE_LINE_INDEX + i, 3);
 	    	MobileApiToolsUtil.writeResult(TITLE_LINE_INDEX, TITLE_LINE_INDEX + i, "FailHint", "【"+ExpectedList+"】和【"+ActualList+"】不一致");
 	    	Assert.fail(""+ExpectedList.replace("_Exp", "")+" =>Expected 【"+ Expected +"】"+" "+"but found 【"+ Actual +"】");
 	    }
	}
	
	/**
	 * <br>根据用例ID，获取用例名称信息，打印到控制台并写入Excel</br>
	 * @author  刘智King
	 * @date     2018年4月20日 下午6:01:04
	 * @param  ID
	 */
    public static void GetCaseInfo(int ID) throws Exception {
    	GetExcelInstance();
    	List<Map<String, String>> data = null;
    	data = ExcelUtil.getInstance().readExcelAllData(TITLE_LINE_INDEX);

    	if (data != null) {
                int i = ID;
            	//根据Excel列名称,获取单元格内容
                Map<String, String> map = data.get(i-1);
                String CaseID = map.get("CaseID");
                String CaseName = map.get("CaseName");
  
                String message_Exp = map.get("message_Exp");
                String message_Act = map.get("message_Act");
                String status_Exp = map.get("status_Exp");
                String status_Act = map.get("status_Act");
                String status_name_Exp = map.get("status_name_Exp");
                String status_name_Act = map.get("status_name_Act");
                
                String StatusCode = map.get("StatusCode");
                String TestResult = map.get("TestResult");
                String FailHint = map.get("FailHint");

    	        //打印日志
    	        logger.info("CaseID: " + CaseID + ", CaseName: " + CaseName +  
    	                ", message_Exp: " + message_Exp +", message_Act: " + message_Act+
    	                ", status_Exp: " + status_Exp +", status_Act: " + status_Act+
    	                ", status_name_Exp: " + status_name_Exp +", status_name_Act: " + status_name_Act+
    	                ", StatusCode: " + StatusCode +", TestResult: " + TestResult + ", FailHint: " + FailHint + "");
    	        logger.info("==================================================================");

                 System.out.println("CaseID: " + CaseID + ", CaseName: " + CaseName +  
                		 ", message_Exp: " + message_Exp +", message_Act: " + message_Act+
                		 ", status_Exp: " + status_Exp +", status_Act: " + status_Act+
    	                ", status_name_Exp: " + status_name_Exp +", status_name_Act: " + status_name_Act+
                		 ", StatusCode: " + StatusCode +", TestResult: " + TestResult + ", FailHint: " + FailHint + "");
                  System.out.println("==================================================================");   
            }
    }
}